<template>

  <el-row>

    <el-radio-group v-model="radio">
      <el-col :span="24">
        <div v-for="item in options" :key="item.code">
          <el-radio :label="item.code">
            {{ item.code }}: <el-input v-model="item.title" />
          </el-radio>
        </div>
      </el-col>
    </el-radio-group>
  </el-row>

</template>

<script>
export default {
  name: 'Radio',
  data() {
    return {
      radio: '',
      options: [
        {
          code: 'A',
          title: '',
          img: '1',
          isRight: 'false'
        },
        {
          code: 'B',
          title: '',
          img: '',
          isRight: 'false'
        },
        {
          code: 'C',
          title: '',
          img: '1',
          isRight: 'false'
        },
        {
          code: 'D',
          title: '',
          img: '1',
          isRight: 'false'
        }
      ]
    }
  },
  methods: {
    shujuchuli() {
      return this.options.map(item => {
        let isRight
        if (item.code === this.radio) {
          isRight = 1
        } else {
          isRight = 0
        }
        return {
          ...item,
          isRight
        }
      })
    }
  }
}
</script>

<style scoped>
 .el-col {
  margin-bottom: 30px;
 }
</style>
